.rules-page {
  max-width: 1400px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 24px;
}

.rules-title {
  margin: 0 !important;
}

.rules-description {
  margin-left: 8px;
  display: block;
  margin-top: 4px;
}

.filter-card {
  margin-bottom: 16px;
}

.filter-card .ant-card-body {
  padding: 16px 24px;
}

.statistics-section {
  margin-bottom: 16px;
}

.rule-table {
  margin-top: 0;
}

.rule-table .ant-table-cell {
  padding: 12px 16px;
  vertical-align: middle;
}

/* 规则名称列的单元格样式 */
.rule-table .ant-table-cell:nth-child(2) {
  vertical-align: top;
}

.rule-table .ant-table-tbody > tr:hover > td {
  background: #fafafa;
}

.rule-id-tag {
  font-weight: 500;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.rule-name-link {
  color: #1890ff !important;
  text-decoration: none;
  height: auto;
  min-height: 32px;
  padding: 4px 0;
  font-weight: 500;
  text-align: left;
  justify-content: flex-start;
  white-space: normal !important;
  word-break: break-all;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: 2.8em;
}

.rule-name-link:hover {
  color: #40a9ff !important;
}

/* 数据库类型两列布局 */
.database-type-columns {
  width: 100%;
}

.db-type-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.db-type-item .ant-tag {
  margin: 0;
  font-size: 11px;
  padding: 2px 6px;
  line-height: 16px;
}

.severity-tag,
.status-tag {
  font-weight: 500;
}

.detail-modal {
  max-width: 900px;
}

.detail-modal .ant-descriptions-item-label {
  font-weight: 600;
  background-color: #fafafa;
}

.rule-pattern-code {
  background-color: #f5f5f5 !important;
  padding: 8px 12px !important;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
}

.example-sql-code {
  background-color: #fff2e8 !important;
  padding: 8px 12px !important;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
}

.suggested-sql-code {
  background-color: #f6ffed !important;
  padding: 8px 12px !important;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 表格样式统一 */
.rule-table .ant-table-pagination {
  margin: 16px 0 0 0;
}

.rule-table .ant-btn-link {
  height: auto;
  line-height: 1.5;
  padding: 0;
}

.rule-table .ant-tag {
  margin: 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .rules-page {
    max-width: 100%;
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .rules-page {
    padding: 0 12px;
  }

  .page-header {
    margin-bottom: 16px;
  }
  
  .filter-card .ant-row {
    flex-direction: column;
    align-items: stretch !important;
  }
  
  .filter-card .ant-col {
    margin-bottom: 8px;
  }

  .filter-card .ant-space {
    flex-wrap: wrap;
  }

  .rule-table .ant-table {
    font-size: 12px;
  }

  .database-type-columns {
    flex-direction: column;
  }

  .db-type-item {
    align-items: center;
  }

  .detail-modal {
    margin: 0 8px;
    max-width: calc(100vw - 16px);
  }
}

/* 批量操作区域样式 */
.filter-card .ant-divider-horizontal {
  margin: 12px 0;
}

/* 空状态样式 */
.rules-page .ant-empty {
  padding: 40px 0;
}

/* 加载状态优化 */
.rules-page .ant-spin-nested-loading {
  min-height: 200px;
}
